﻿using System;
using System.Configuration;
using System.Collections.Generic;

namespace TempEmployees.Web
{
    public static class WebConfigConfigurations
    {
        public static IDictionary<int, RoleElement> Roles { get; private set; }

        static WebConfigConfigurations()
        {
            ReadConfigurations();
        }

        private static void ReadConfigurations()
        {
            GuiConfigurationSection configuration = ConfigurationManager.GetSection("GuiConfiguration") as GuiConfigurationSection;

            Roles = new Dictionary<int, RoleElement>();
            foreach (RoleElement role in configuration.Roles) Roles.Add(role.ID, role);
        }
    }
}